<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
//            $table->string('nickname');
//            $table->string('email')->unique();
//            $table->timestamp('email_verified_at')->nullable();
//            $table->string('password');
//            $table->rememberToken();

            $table->string('nickname',64)->nullable()->comment('昵称');
            $table->string('mobile',16)->unique()->nullable()->comment('手机号');
            $table->string('password')->default('')->comment('密码');
            $table->string('avatar')->comment('头像');
            $table->unsignedTinyInteger('gender')->default(0)->comment('性别');
            $table->string('provider',16)->nullable()->comment('登录提供方');
            $table->string('openid', 100)->nullable()->comment('openid');
            $table->string('unionid', 100)->nullable()->comment('unionid');
            $table->unsignedTinyInteger('state')->default(1)->comment('状态');

            $table->unsignedBigInteger('integral')->default(0)->comment('签到积分');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
};
